﻿using System;
using System.Data;
using System.Data.Common;
using System.Collections.Generic;

namespace WS.DAL
{
    using IBatisNet.DataMapper;

    /// <summary>
    /// Data access layer
    /// </summary>
    public abstract class BaseDAL : IDisposable
    {
        /// <summary>
        /// Access to database
        /// </summary>
        internal SqlMapper _sqlMapper = Mapper.Instance();

        /// <summary>
        /// Empty table
        /// </summary>
        internal DataTable _tb = new DataTable("Tmp");

        /// <summary>
        /// Get system time (on Web Server)
        /// </summary>
        /// <returns></returns>
        public DateTime GetDate()
        {
            return DateTime.Now;
        }

        /// <summary>
        /// Dispose empty table and access to database
        /// </summary>
        public void Dispose()
        {
            _tb.Dispose();
            _tb = null;
        }
    }
}